<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic" %>
<%@page import="com.ordobill.webapp.common.DateUtil"%>
<%@ include file="../Include/Config.jsp"%>
<% 
String curDate = DateUtil.getCurrentDate();
%>
<html>
  <head>
    <title>Web Ram Program</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <link href="ram/style.css" rel="stylesheet" type="text/css">
    <script type="text/javascript" src="js/jquery-1.7.1.js"></script>
    <script type="text/javascript">
    $(function(){

    	<logic:messagesPresent message="true">
    	  <html:messages message="true" id="msg">
    	    var msgs = '<bean:write name="msg" />'; 
	        msgs = msgs.replace(/\?/g, '');
	        msgs = msgs.replace(/en_US./g, '');
	        msgs = msgs.replace(/ko_KR./g, '');
            if(msgs.search("성공") > 0){
            	alert(msgs);
                location.href="project.do?proId=${sessionScope.unitIDInSession}";
            }
    	  </html:messages>
        </logic:messagesPresent>

        $("img#insertImg").css("cursor","pointer").click(function(){

            var proName = $("#proName").val();
            if(proName == "" || proName == undefined ){
                alert("프로젝트 명을 입력하세요");
                $("#proName").focus();
                return false;
             }
           
			
            var proRegdate = $("#proRegdate").val();
            if(proRegdate == "" || proRegdate == undefined ){
                alert("프로젝트 시작날짜를 입력하세요");
                $("#proRegdate").focus();
                return false;
             }
			
			
			
			var proJob = $("#proJob").val();
            if(proJob == "" || proJob == undefined ){
                alert("직업을 입력해 주세요.");
                $("#proJob").focus();
                return false;
             }            
            var proClient = $("#proClient").val();
            if(proClient == "" || proClient == undefined ){
                alert("고객사를 입력해 주세요.");
                $("#proClient").focus();
                return false;
             }            
            var proContact = $("#proContact").val();
            if(proContact == "" || proContact == undefined ){
                alert("담당자를 입력해 주세요.");
                $("#proContact").focus();
                return false;
             }
            var proOriginator = $("#proOriginator").val();
            if(proOriginator == "" || proOriginator == undefined ){
                alert("발기인을 입력해 주세요.");
                $("#proOriginator").focus();
                return false;
             }
            var proCheckBy = $("#proCheckBy").val();
            if(proCheckBy == "" || proCheckBy == undefined ){
                alert("선택을 입력해 주세요.");
                $("#proCheckBy").focus();
                return false;
             } 

            if(confirm("저장하시겠습니까?")){
                $("form")[0].submit();
            }
        });
    });    
    </script>
        <link type="text/css" href="js/day/ui.all.css" rel="stylesheet" />
    <script type="text/javascript" src='js/day/jquery-1.3.2.js'></script>
    <script type="text/javascript" src='js/day/ui.core.js'></script>
    <script type="text/javascript" src='js/day/ui.datepicker.js'></script>
    <script type="text/javascript">
			$(function() {
				$.datepicker.setDefaults({
				    monthNames: ['년 1월','년 2월','년 3월','년 4월','년 5월','년 6월','년 7월','년 8월','년 9월','년 10월','년 11월','년 12월'],
				    dayNamesMin: ['일', '월', '화', '수', '목', '금', '토'],
				    showMonthAfterYear:true,
				    dateFormat: 'yy-mm-dd',
				    showOn: 'both',
				    buttonImage: 'img/day/date_jquery.gif',
				    buttonImageOnly: true
				});
				$("#proRegdate").datepicker({
				    buttonText: '시작일'
				});
			});
		function commonWork() {
			var stdt = document.getElementById("proRegdate");
		}
	</script>
  </head>
  <body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
  <form name="smsForm" method="post" action="project-submit.do" onsubmit="return false;">
    <input type="hidden" name="method" value="insert" />
     <input type="hidden" name="proId" value="${sessionScope.unitIDInSession}" />
     <table width="100%" border="0" cellspacing="0" cellpadding="0">
       <tr>
         <td align="center">
           <table width="100%" border="0" cellspacing="0" cellpadding="0">
             <tr> 
               <td height="60">
                 <!----- header ----------->
                 <%@ include file="../Include/Header.jsp"%>
                 <!----- header end ----------->
               </td>
             </tr>
             <tr>
               <td>
                 <div align="left">
                   <table width="1251" border="0" cellpadding="0" cellspacing="0">
                     <tr valign="top">
                       <td width="180" height="473">
                         <%@ include file="../Include/Project_Left.jsp"%>
                       </td>
                        <td width="20">&nbsp;</td>
                        <td>
                          <table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td>
<!----<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
  <td height="30" align="center" bgcolor="#333333"><font color="#FFFFFF"><strong>Project 등록</strong></font></td>
</tr>
<tr>
  <td height="1" bgcolor="f44901"></td>
</tr>
<tr>
  <td bgcolor="#f4f4f4">
    <table width="100%" border="0" cellspacing="0" cellpadding="10">
      <tr>
        <td valign="top">
          <table width="100%" border="0" cellspacing="0" cellpadding="0">
            <tr>
              <td height="22">ㆍProject 등록 페이지 입니다.</td>
            </tr>
          </table>
        </td>
      </tr>
    </table>
  </td>
</tr>
</table>--->
    <img src="ram/images/project-reg.jpg"></td>
  </tr>
  <tr>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
  <!------------------------------------------ 프로그램 적용 시작 -------------------------------->
  <td>
    <table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td height="30"><font color="ff3300"><b>기본정보</b></font></td>
      </tr>
      <tr>
        <td>
          <table width="100%" border="0" cellspacing="0" cellpadding="0">
            <tr>
              <td bgcolor="#DDDDDD">
                <table width="100%" border="0" cellspacing="1" cellpadding="5" align="center">
                  <tr>
<td width="768" height="30" bgcolor="#f4f4f4" colspan="2">
  <p><strong>Overview</strong></p>
</td>
                  </tr>                 
                  <tr>
<td height="30" bgcolor="#f4f4f4" width="164">Project name</td>
<td height="30" bgcolor="#FFFFFF" width="593">
  <p><input name="proName" id="proName" type="text" class="grayform" value="" size="36"><font color="408EA8">*</font></p>
</td>
</tr>






 <tr>
<td height="30" bgcolor="#f4f4f4" width="164">Reg date</td>
<td height="30" bgcolor="#FFFFFF" width="593">
  <p><input type="text" id="proRegdate" name="proRegdate"  onchange="commonWork()" class="grayform" size="10" value="<%=curDate%>">
  <font color="408EA8">*</font></p>
</td>
</tr>													   
													   
													   
													   
													   
													   
													   
													   <tr>
  <td height="30" bgcolor="#f4f4f4" width="164">Job</td>
  <td width="593" height="30" bgcolor="#FFFFFF">
    <p><input name="proJob" id="proJob" type="text" class="grayform" value="" size="36"><font color="408EA8">*</font></p>
  </td>
</tr>
<tr>
  <td height="30" bgcolor="#f4f4f4" width="164">Client</td>
  <td height="14" bgcolor="#FFFFFF" width="593">
    <p><input name="proClient" id="proClient" type="text" class="grayform" value="" size="36"><font color="408EA8">*</font></p>
  </td>
</tr>
<tr>
  <td height="30" bgcolor="#f4f4f4" width="164">Contact</td>
  <td height="15" bgcolor="#FFFFFF" width="593">
    <p><input name="proContact" id="proContact" type="text" class="grayform" value="" size="36"><font color="408EA8">*</font></p>
  </td>
</tr>
<tr>
  <td height="30" bgcolor="#F4F4F4" width="164">Note</td>
  <td height="15" bgcolor="white" width="593">
    <p><input name="proNote" id="proNote" type="text" class="grayform" value="" size="36"></p>
  </td>
</tr>
<tr>
    <td height="30" bgcolor="#F4F4F4" width="768" colspan="2"><b>Quality Assurance</b></td>
</tr>
<tr>
    <td height="30" bgcolor="#F4F4F4" width="164">Originator</td>
    <td height="15" bgcolor="white" width="593">
      <p><input name="proOriginator" id="proOriginator" type="text" class="grayform" value="" size="36"><font color="408EA8">*</font></p>
    </td>
  </tr>
<tr>
  <td height="30" bgcolor="#F4F4F4" width="164">Checked by</td>
  <td height="15" bgcolor="white" width="593">
    <p><input name="proCheckBy" id="proCheckBy" type="text" class="grayform" value="" size="36"></p>
  </td>
</tr>
                  </table>
                </td>
              </tr>
            </table>
          </td>
        </tr>
        <tr>
          <td height="50" align="center"><img id="insertImg" src="ram/images/btn_input.jpg" border="0"></td>
        </tr>
        <tr>
          <td>&nbsp;</td>
        </tr>
      </table>
    </td>
    <!------------------------------------------ 프로그램 적용 끝 -------------------------------->
  </tr>
</table>
</td>
    </tr>
    <tr>
<td>&nbsp;</td>
    </tr>
    <tr>
<td>&nbsp;</td>
    </tr>
  </table>
  <p>&nbsp;</p>
</td>
                        </tr>
                      </table>
                    </div>
                  </td>
                </tr>
              <tr>
                <td align="center">
                   <%@ include file="../Include/Foot.jsp"%>
                </td>
              </tr>
            </table>
          </td>
        </tr>
      </table>
   </form>
  </body>
</html>